﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemWFH.Domain;
using SystemWFH.Infrstructer.Interface;

namespace SystemWFH.Infrstructer.Impl
{
    public class ProductionPlanningRepository : BaseRepository<ProductionPlanning>, IProductionPlanningRepository
    {
        public ProductionPlanningRepository(SystemWFHDbContext context) : base(context) { }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="productionPlanning"></param>
        /// <returns></returns>
        public async Task<int> AddedAsync(ProductionPlanning productionPlanning)
        {
            try
            {
                return await base.Add(productionPlanning);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="productionPlanning"></param>
        /// <returns></returns>
        public async Task<int> UpdateAsync(ProductionPlanning productionPlanning)
        {
            try
            {
                return await base.Update(productionPlanning);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="workshopId"></param>
        /// <returns></returns>
        public async Task<int> DeleteAsync(int productionId)
        {
            try
            {
                return await base.Delete(productionId);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public async Task<List<ProductionPlanning>> GetAllAsync()
        {
            try
            {
                return await base.GetAll();
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">ID</param>
        /// <returns></returns>
        public async Task<int> DeleteByIdAsync(int id)
        {
            try
            {
                return await base.Delete(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="workshopId"></param>
        /// <returns></returns>
        public async Task<ProductionPlanning> GetByIdAsync(int productionId)
        {
            try
            {
                return await base.GetValue(productionId);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="workshopId"></param>
        /// <returns></returns>
        public Task<int> ProductionPlanningDeletePi(string productionId)
        {
            throw new NotImplementedException();
        }
    }
}
